package com.huahua.api.entity.pojo;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import java.time.LocalDateTime;

/**
 * @author Huahua-Ai
 * @date 2025-07-24 17:45:00
 * @description 云打印任务实体
 */
@Data
@Accessors(chain = true)
@Table("cloud_print_job")
public class CloudPrintJob {

    @Id
    private Long id;

    @Column("job_id")
    private String jobId;

    @Column("request_id")
    private String requestId;

    @Column("device_id")
    private String deviceId;

    @Column("printer_name")
    private String printerName;

    @Column("job_status")
    private String jobStatus;

    @Column("job_state")
    private Integer jobState;

    @Column("job_state_message")
    private String jobStateMessage;

    @Column("job_state_reasons")
    private String jobStateReasons; // JSON字符串

    @Column("title")
    private String title;

    @Column("url")
    private String url;

    @Column("copies")
    private Integer copies;

    @Column("advanced_parameters")
    private String advancedParameters; // JSON字符串，包含所有打印参数

    // 常用打印参数（冗余存储，便于查询）
    @Column("paper_size")
    private String paperSize;

    @Column("paper_type")
    private String paperType;

    @Column("color_mode")
    private String colorMode;

    @Column("sides")
    private String sides;

    @Column("orientation")
    private String orientation;

    @Column("print_quality")
    private String printQuality;

    // 任务执行信息
    @Column("total_pages")
    private Integer totalPages;

    @Column("printed_pages")
    private Integer printedPages;

    @Column("error_message")
    private String errorMessage;

    @Column("submitted_at")
    private LocalDateTime submittedAt;

    @Column("started_at")
    private LocalDateTime startedAt;

    @Column("completed_at")
    private LocalDateTime completedAt;

    @Column("updated_at")
    private LocalDateTime updatedAt;
}
